#ifndef CPUSHBUTTON_H
#define CPUSHBUTTON_H

#include <QPushButton>
#include <QObject>

class CPushButton : public QPushButton
{
    Q_OBJECT

public:
    explicit CPushButton(QWidget* parent = nullptr);
    explicit CPushButton(const QString &text, QWidget *parent = nullptr);

protected:
    virtual void paintEvent(QPaintEvent *event) override;

    void enterEvent(QEvent *event) override;
    void leaveEvent(QEvent *event) override;
    void mousePressEvent(QMouseEvent  *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;

private:
    void paintEventDefault(QPaintEvent* event);
    void paintEventHover(QPaintEvent* event);
    void paintEventPressed(QPaintEvent* event);

private:
    bool m_isHovered;
    bool m_isPressed;
};

#endif // CPUSHBUTTON_H
